import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
  //定义状态
  state: {
    projects: [], //所有项目
    person: "", //用户
    userName: "", //用户名称
    userInfo: "", //用户信息
    userRole: "",//用户角色
    userPassword: "", //用户密码
    userID: "", //用户ID
    workNumber: "",
    workStatistics: "",
    // sameURL: "/api/jrj_itm" //dev
    sameURL:".."  //build


  },
  mutations: {

    //获取用户密码
    getCurrentUserPassword(state, msg) {
      state.userPassword = msg;
    },


    //更新用户信息
    updateUserInfo(state, msg) {
      state.userName = msg.properties.name
      state.userInfo = msg
    },

    //更新用户角色信息
    updateUserRole(state, msg) {
      state.userRole = msg
    }

  }
})

export default store
